package com.cl.service.imp;

import com.cl.dao.UserRepository;
import com.cl.po.User;
import com.cl.service.UserService;
import com.cl.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author:Long
 * @Date:Created in 13:11 2018/7/2
 * @Description:
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Util.toMD5(password));
        return user;
    }
}
